<template>
  <a-card class="j-inner-table-wrapper" :bordered="false">

    <!-- 查询区域 begin -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="8" :md="8" :sm="24">
            <a-form-item label="缴费账户">
              <a-input v-model="queryParam.accCode" style="width:160px;" placeholder="缴费账户"/>
            </a-form-item>
          </a-col> 
          <a-col :xl="4" :lg="6" :md="8" :sm="24">
            <span class="table-page-search-submitButtons table-operator">
              <a-button type="primary" icon="search" @click="searchQuery">查询</a-button>                   
            </span>
          </a-col>
          <a-col :xl="2" :lg="4" :md="6" :sm="24">
          </a-col>
           <a-col :xl="4" :lg="6" :md="8" :sm="24">
            <span class="table-page-search-submitButtons table-operator">
              <a-button type="primary" icon="pay-circle" style="margin-left:20px;" @click="handleFeeDerate">减免保存</a-button>                   
            </span>
          </a-col>
        </a-row>
        <a-row>
           <a-col :xl="6" :lg="8" :md="8" :sm="24">
            <a-form-model-item label="减免原因："  prop="feeStrikeCause">
              <j-dict-select-tag type="list" v-model="queryParam.feeStrikeCause" style="width:160px;" 
                  class="inpRequire" dictCode="fee_strike_cause"  ></j-dict-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :xl="6" :lg="8" :md="8" :sm="24" prop="responMan">
            <a-form-item label="减免金额">
              <a-input v-model="queryParam.money" class="inpRequire"  style="width:160px;" placeholder="减免金额"/>
            </a-form-item>
          </a-col> 
          <a-col :xl="6" :lg="8" :md="8" :sm="24">
            <a-form-model-item label="批准人"  prop="responMan">
              <a-input v-model="queryParam.responMan" class="inpRequire" placeholder="请输入批准人" ></a-input>
              <a-input v-model="queryParam.arrearIds" hidden  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :xl="6" :lg="8" :md="8" :sm="24">
            <a-form-model-item label="备注"  prop="remark">
              <a-input v-model="queryParam.remark" placeholder="请输入备注" ></a-input>
            </a-form-model-item>
          </a-col>
         
        </a-row>
      </a-form>
    </div>


    <!-- 查询区域 end -->

   

    <!-- table区域 begin -->
     

    <div>      
      <a-tabs defaultActiveKey="1" style="margin:0px;">
        <a-tab-pane tab="欠费明细" key="1" >
          <ChgDeratefeeList ref="deratefeeListChild"   />
        </a-tab-pane>
      </a-tabs>      
    </div>
    <!-- table区域 end -->

  </a-card>
</template>

<script>

  import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
  import JDate from '@/components/jeecg/JDate.vue'
  import ChgDeratefeeList from './ChgDeratefeeList'
  import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  import '@/assets/less/TableExpand.less'

  export default {
    name: 'ChgDeratefeeForm', 
    components: {     
      JDate,
      JDictSelectTag,
      ChgDeratefeeList
    },
    data() {
      return {
        description: '弹框费用减免-表单',
        validatorRules: {
          cusId: [
            { required: true, message: '请输入户号!'},
          ],      
      },
        superFieldList:[],
        queryParam:{
          accCode: '',   
          feeStrikeCause: null,      
          responMan: '',
          money: null,
          remark: '',

        }
      }
    },
    created() {
     
    },
    computed: {
      
    },
    methods: {
      add(){

      },
      searchQuery(){
        this.$refs.deratefeeListChild.setQueryParam(this.queryParam);
      },
      handleFeeDerate(){         
        let ok=1;
        if( !this.queryParam.feeStrikeCause){
          ok=0;
          this.$message.warning('减免原因不能为空') 
        }
        if( !this.queryParam.money){
          ok=0;
          this.$message.warning('减免金额不能为空') 
        }
        if(!this.queryParam.responMan){
          ok=0;
           this.$message.warning('批准人不能为空') 
        }
        if(ok == 1){
          this.$emit('handleDeratefee');            
        }
      },
      getBillParam(){
        let rows=this.$refs.deratefeeListChild.getSelectDataRowIds();
        this.queryParam.arrearRow= rows;
        return this.queryParam;
      },
      handleExpand(expanded, record) {
        this.expandedRowKeys = []
        if (expanded === true) {
          this.expandedRowKeys.push(record.id)
        }
      }
   
    }
  }
</script>
<style lang="less" scoped>
  @import '~@assets/less/common.less';
  .inpRequire {
    border: 1px solid #974c4c;
  }
</style>